package cn.skyquant.quant4j.service.boot.model.ea;

import cn.skyquant.quant4j.service.boot.model.account.Account;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;

import java.util.Optional;

@Repository
public interface EaManagerRepository extends CrudRepository<EaManager, Integer> {

    @Query("select u from EaManager u where u.ea=?1 and u.eaId=?2 and u.account=?3")
    Optional<EaManager> getByKey(String ea, Integer eaId, Account account);

    Iterable<EaManager> findByEa(String ea);
}
